x <- 10:1
y <- -4:5
q <- c("Hockey","Football","Baseball","Curling","Rugby","Lacrosse","Baseketball","
       tennis","Cricket","Soccer")
theDF <- data.frame(x,y,q)
print(theDF)

theDF <- data.frame(First=x,Second=y,Sport=q)
print(theDF)
print(nrow(theDF))
print(ncol(theDF))
print(dim(theDF))
print(names(theDF))
print(names(theDF)[3])
print(rownames(theDF))
rownames(theDF) <- c("one","two","three","four","five","six","seven","eight","nine","ten")
print(theDF)
rownames(theDF) <- NULL
print(rownames(theDF))
print(head(theDF))
print(head(theDF,n=7))
print(tail(theDF))
print(class(theDF))
print(theDF$Sport)
print(theDF[3,2])
print(theDF[3,2:3])
print(theDF[c(3,5),2])
print(theDF[c(3,5),2:3])
print(theDF[,3])
print(theDF[,2:3])
print(theDF[2,])
print(theDF[2:4,])
print(theDF[,c("First","Sport")])
print(theDF[,"Sport"])
print(class(theDF[,"Sport"]))
print(class(theDF["Sport"]))
print(theDF[,"Sport",drop=FALSE])
print(class(theDF[,"Sport",drop=FALSE]))
print(theDF[,3,drop=FALSE])
print(class(theDF[,3,drop=FALSE]))
newFactor <- factor(c("Pennsylvania","New York","New Jersey","New York","Tennessee","Massachusetts","Pennsylvania","New York"))
print(model.matrix(~ newFactor - 1))